<script>
jQuery(document).ready(function($){	

	//Botão cancelar
	$("#cancel").click(function() {
		$.blockUI({ message: $('<p style="font-size:15px;">Aguarde Carregando...</p>') });
		var url = '<?php echo WWW_APP.'questions/index/unit/'.$unitid?>';		
		window.location.href= url;			
	});
			
});
</script>
<script type="text/javascript" src="<?php echo WWW_ROOT.'js/validate.js'?>"></script>

<div id='question_add'>
	<!-- 
	<div id="questions_list_add" class="units">	
		<?php 
		if(!isset($questions_list)) {
			echo "Não existe perguntas no banco de dados.";
		}
		?>
		<ul>
			<?php 
			foreach($questions_list as $key=>$question):			
			?>
				<li><a href="<?php echo WWW_APP.'questions/visualize/unit/'.$question->unitid.'/question/'.$key?>"><?php echo $question->question?></a></li>
			<?php 	
			endforeach;
			?>
		</ul>
	</div>	
	
	
	<br /><br />
	 -->
	 
	 
	<form id="question_form" name="question_add_form" method="post">
		
		<label>Conceito relacionado: <span class="red">*</span></label>
		<select name="related_concept" class="ui-widget ui-state-default ui-corner-all">
			<?php foreach($concepts as $key=>$concept):?>
				<option value="<?php echo $key?>"><?php echo $concept;?></option>
			<?php endforeach;?>
		</select>		
		<br /><br />
		
		<label>Pergunta <span class="red">*</span></label>
		<br />
		<textarea name="question" rows="6" cols="70" class="ui-widget-content ui-corner-all"></textarea>
		<br /><br />
		
		<label>Resposta 1 <span class="red">*</span></label>
		<br />
		<textarea name="answer_1" rows="3" cols="70" class="ui-widget-content ui-corner-all"></textarea>
		<br /><br />
		
		<label>Resposta 2 <span class="red">*</span></label>
		<br />
		<textarea name="answer_2" rows="3" cols="70" class="ui-widget-content ui-corner-all"></textarea>
		<br /><br />
		
		<label>Resposta 3 <span class="red">*</span></label>
		<br />
		<textarea name="answer_3" rows="3" cols="70" class="ui-widget-content ui-corner-all"></textarea>
		<br /><br />
		
		<label>Resposta 4 <span class="red">*</span></label>
		<br />
		<textarea name="answer_4" rows="3" cols="70" class="ui-widget-content ui-corner-all"></textarea>
		<br /><br />
		
		<label>Resposta 5 <span class="red">*</span></label>
		<br />
		<textarea name="answer_5" rows="3" cols="70" class="ui-widget-content ui-corner-all"></textarea>
		<br /><br />
		
		<label>RESPOSTA CORRETA: <span class="red">*</span></label>
		<select name="answer_correct" class="ui-widget ui-state-default ui-corner-all">
			<option value="">Escolha a reposta</option>
			<option value="1">Resposta 1</option>
			<option value="2">Resposta 2</option>
			<option value="3">Resposta 3</option>
			<option value="4">Resposta 4</option>
			<option value="5">Resposta 5</option>
		</select>
		<br /><br /><br />
		
		<input type="submit" value="Salvar" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
		<input  id="cancel" type="button" value="Cancelar" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
		
	</form>

</div>
